#include "MenuScene.h"
#include "SceneManager.h"
#include "GameScene.h"

CMenuScene::CMenuScene()
{
	CCSize winSize = CCDirector::sharedDirector()->getWinSize();
	mLayer = new CMenuLayer();
	mLayer->init();
	mLayer->setTouchEnabled(true);
	this->addChild(mLayer);
	mLayer->release();
	CCRect rect = CCRectMake(0,0,480,320);
	CCScale9Sprite* backGround = CCScale9Sprite::create("menu.png",rect,rect);
	backGround->setContentSize(winSize);
	backGround->setPosition(ccp(winSize.width/2,winSize.height/2));
	mLayer->addChild(backGround);
}
CMenuScene::~CMenuScene()
{

}






void CMenuLayer::ccTouchesEnded(CCSet* touches, CCEvent* event)
{
	CGameScene* scene = (CGameScene*)SceneManager->GetScene(GameScene);
	scene->Init(1);
	SceneManager->SwitchScene(GameScene);
}


